#  FieldVis - A Tool for Visualizing Astrophysical Magnetohydrodynamic Flow
#     
#  Copyright (C) 2006 - 2008     FieldVis Development Team
# 
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
# 
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
# 
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#  File         : makefile
#  Author       : Blayne Field


CC = g++

# Normal build
CFLAGS = -O2 -Wall
LDFLAGS =

# Profile build
#CFLAGS = -pg -O2 -Wall
#LDFLAGS = -pg

# Debug build
#CFLAGS = -g -O2 -Wall
#LDFLAGS =

# INCPATH is the path to the file glut.h on the build system
INCPATH = -I/usr/include
LIBPATH = -L/usr/local/lib -L/usr/X11R6/lib64 -L/usr/X11R6/lib -Wl,-rpath -Wl,/usr/local/lib
#LIBS =  -lglut -lGL -lGLU -lXmu -lX11 -lXi -lpthread -lm
LIBS =  -lglut -lGL -lGLU -lX11 -lpthread -lm

EXECUTABLE = fieldvis

SOURCES = Vector3D.cpp Point.cpp StreamlinePath.cpp Integrator.cpp Streamtube.cpp ConfigFile.cpp ColorMap.cpp camera.cpp Matrix4x4.cpp capture.cpp Texture.cpp CubicSplinePolynomial3D.cpp TextWriter.cpp Field.cpp DataSet.cpp ResourceFile.cpp BoundingBox.cpp SelectionPlane.cpp SelectionCube.cpp DisplayMode.cpp Animation.cpp UIState.cpp FieldVis.cpp 

OBJECTS = $(SOURCES:.cpp=.o)

all: $(OBJECTS) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) $(LIBPATH) $(INCPATH) $(LIBS) -o $@

.cpp.o:
	$(CC) $(CFLAGS) $(INCPATH) -c $<

clean:
	rm -f *.o $(EXECUTABLE)

